<template>
  <div>
    <div>
      <el-card>
        <div class="top">
          <div class="avatar">
            <img src="https://react-project-try-1320075701.cos.ap-guangzhou.myqcloud.com/%E5%A4%B4%E5%83%8F.jpg" alt="" />
          </div>
          <div class="name">{{ getTime() }}{{ name }}</div>
          <el-tag type="success" v-for="item in roles" :key="item">{{ item }}</el-tag>
        </div>
      </el-card>
    </div>
    <div class="bottom">
      <SvgIcon name="welcome" width="600px" height="300px"></SvgIcon>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useUserStore } from '@/store/module/user'
import { getTime } from '@/utils/time'
import { storeToRefs } from 'pinia'
const userStore = useUserStore()

const { name, roles } = storeToRefs(userStore)
</script>

<style lang="scss" scoped>
.top {
  display: flex;
  align-items: center;

  .avatar {
    img {
      height: 200px;
      width: 200px;
      border-radius: 50%;
    }
  }

  .name {
    color: rgb(9, 247, 191);
    font-size: 30px;
    font-weight: 700;
    margin-left: 20px;
  }
}

.bottom {
  margin-top: 10vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
